const text = "[00:09.90]词：[00:10.45]李[00:11.00]\n[00:11.10]曲：[00:12.00]影[00:13.20]";


// 将每一行转为 JSON 对象
const jsonArr = [];

text.split('\n').forEach(line => {
    const pText = line.replaceAll(pText1,"");
    console.log(pText)
    const pSpanMatches = Array.from(line.matchAll(regex), match => {
        const startTime = parseFloat(match[1]) * 60 + parseFloat(match[2]) + parseFloat(match[3]) / 100;
        const endTime = parseFloat(match[5]) * 60 + parseFloat(match[6]) + parseFloat(match[7]) / 100;
        const playTime = (endTime - startTime) * 1000;
        return {
            text: match[4].trim(),
            wait: 0,
            playTime: Math.round(playTime),
            startTime: startTime.toFixed(2),
        };
    });
    jsonArr.push({
        pText: pText,
        startTime: pSpanMatches[0].startTime,
        pSpan: pSpanMatches,
    });
});


